## mako

<%page expression_filter="h"/>

<%namespace name='static' file='../../static_content.html'/>
<%namespace file='../../main.html' import="login_query"/>
<%!
from django.urls import reverse
from django.utils.translation import gettext as _
%>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
  <ul class="navbar-nav mr-auto">
     % if course:
      <div class="course-header">
        <span class="provider">${course.display_org_with_default}:</span>
        <span class="course-number">${course.display_number_with_default}</span>
        <%
        display_name = course.display_name_with_default
        if settings.FEATURES.get('CUSTOM_COURSES_EDX', False):
          ccx = get_current_ccx(course.id)
          if ccx:
            display_name = ccx.display_name
        %>
        <span class="course-name">${display_name}</span>
      </div>
    % endif


    % if settings.FEATURES.get('COURSES_ARE_BROWSABLE') and not show_program_listing:
      <li class="nav-item mt-2 nav-item-open-collapsed">
        <a class="nav-link" href="${marketing_link('COURSES')}">${_('Explore courses')}</a>
      </li>
    % endif

    % if show_dashboard_tabs:
      <li class="nav-item mt-2 nav-item-open-collapsed">
        <a class="nav-link ${'active' if reverse('dashboard') == request.path else ''}" href="${reverse('dashboard')}">
          ${_("Courses")}
        </a>
      </li>
      % if show_program_listing:
        <li class="nav-item mt-2 nav-item-open-collapsed">
          <a class="nav-link ${'active' if reverse('program_listing_view') in request.path else ''}" href="${reverse('program_listing_view')}">
            ${_("Programs")}
          </a>
        </li>
      % endif
    % endif
  </ul>

  <ul class="navbar-nav navbar-right">
    % if settings.FEATURES.get('ENABLE_HELP_LINK'):
      <li class="nav-item mt-2 nav-item-open-collapsed">
        <a href="${get_online_help_info(online_help_token)['doc_url']}"
        rel="noopener"
        target="_blank"
         class="nav-link">${_("Help")}</a>
      </li>
    % endif

    <%include file="../../user_dropdown.html"/>
  </ul>
</div>
